"""
# -*- coding: utf-8 -*-
Time    : 2025/7/22 上午9:49
Author  : Micah
File    : test_addfinalizer02.py
Function:
"""
import pytest


@pytest.fixture()
def demo_fixture(request):
    print("\n执行在用例前的fixture")

    def demo_finalizer():
        print("\n执行在用例后的fixture")

    def demo_finalizer02():
        print("\n执行在用例后的fixture02")

    def demo_finalizer03():
        print("\n执行在用例后的fixture03")

    # 注册demo_finalizer为终结函数  执行顺序与注册顺序相反
    request.addfinalizer(demo_finalizer)
    request.addfinalizer(demo_finalizer02)
    request.addfinalizer(demo_finalizer03)


def test_01(demo_fixture):
    print("\n执行用例test01")


def test_02(demo_fixture):
    print("\n执行用例test02")


def test_03(demo_fixture):
    print("\n执行用例test03")
